import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Lost implements Comparable<Lost> {
    private String LostPlace;
     private String name;//物品名字
     private String WhereToGet;
    private Date LostDate;
    private String Grade;

    public Lost(String lostPlace, String name, String whereToGet, Date lostDate, String grade) {
        LostPlace = lostPlace;
        this.name = name;
        WhereToGet = whereToGet;
        LostDate = lostDate;
        Grade = grade;
    }

    public String getLostPlace() {
        return LostPlace;
    }

    public void setLostPlace(String lostPlace) {
        LostPlace = lostPlace;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getWhereToGet() {
        return WhereToGet;
    }

    public void setWhereToGet(String whereToGet) {
        WhereToGet = whereToGet;
    }

    public Date getLostDate() {
        return LostDate;
    }

    public void setLostDate(Date lostDate) {
        LostDate = lostDate;
    }

    public String getGrade() {
        return Grade;
    }

    public void setGrade(String grade) {
        Grade = grade;
    }

    @Override
    public String toString() {
        return "Lost{" +
                "LostPlace='" + LostPlace + '\'' +
                ", name='" + name + '\'' +
                ", WhereToGet='" + WhereToGet + '\'' +
                ", LostDate=" + LostDate +
                ", Grade='" + Grade + '\'' +
                '}';
    }

    @Override
    public int compareTo(Lost o) {
        return (int) (getLostDate().getTime() - o.getLostDate().getTime());

    }
    /*    public static void main(String[] args) throws ParseException {
        String time="2022年11月2日 8:49:20";
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
        long time1 = simpleDateFormat.parse(time).getTime();
        System.out.println(time1);
    }*/

}
